// import com.alibaba.druid.sql.ast.SQLExpr_ptr;
// import com.alibaba.druid.sql.ast.SQLName_ptr;
// import com.alibaba.druid.sql.ast.SQLStatementImpl;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

#include "SQLCreateUserStatement.h"
#include "../../visitor/SQLASTVisitor.h"

SQLCreateUserStatement::SQLCreateUserStatement()
{
}

SQLName_ptr SQLCreateUserStatement::getUser()
{
  return user;
}

void SQLCreateUserStatement::setUser(SQLName_ptr user)
{
  if (user != nullptr)
  {
    user->setParent(SharedObject(SQLCreateUserStatement));
  }
  this->user = user;
}

SQLExpr_ptr SQLCreateUserStatement::getPassword()
{
  return password;
}

void SQLCreateUserStatement::setPassword(SQLExpr_ptr password)
{
  if (password != nullptr)
  {
    password->setParent(SharedObject(SQLCreateUserStatement));
  }
  this->password = password;
}

// @Override
void SQLCreateUserStatement::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLCreateUserStatement)))
  {
    acceptChild(visitor, user);
    acceptChild(visitor, password);
  }
  visitor->endVisit(SharedObject(SQLCreateUserStatement));
}

// @Override
SQLDDLStatement::DDLObjectType SQLCreateUserStatement::getDDLObjectType()
{
  return SQLDDLStatement::DDLObjectType::USER;
}
